package com.wkbb.sports.mapper;

import com.wkbb.common.base.BaseMapper;
import com.wkbb.sports.dto.ExcelDto1;
import com.wkbb.sports.dto.WorkDateDto;
import com.wkbb.sports.dto.WorkDto;
import com.wkbb.sports.model.HlifeWork;
import com.wkbb.sports.model.HlifeWorkStudent;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author lbh
 * @date 2021年03月29日 17:58:34
 * @description:
 */
@Repository
public interface HlifeWorkMapper extends BaseMapper<HlifeWork> {

    //public void insert1(HifeWorkDto HifeWorkDto);
    public void insert1(HlifeWork hifeWork);

    /**
     * 最近作业列表
     * @param params
     * @return
     */
    public List<WorkDto> getWorkListByTeacherId(Map params);

    /**
     * 作业详情及统计
     * @param workId
     * @return
     */
    public Map<String,Object> getWorkDetail(@Param("workId") Long workId);


    /**
     * 个人作业记录【时长模式】
     * @param workId
     * @param studentId
     * @return
     */
    public Map<String,Object> getStudentPersonalInfoDetail(@Param("workId") String workId,@Param("studentId") String studentId);

    /**
     * 跳绳作业个人统计【PC端】
     * @param studentId
     * @return
     */
    public Map<String,Object> getStudentPersonalInfoDetailForPc(@Param("studentId") Long studentId);

    /**
     * 根据评分标准ID查询评分标准类型
     * @param projectRuleId
     * @return
     */
    public String getMarkTypeByProjectRuleId(@Param("projectRuleId") Long projectRuleId);

    /**
     * 根据作业id查询该作业被催促过的信息
     * @param workId
     * @return
     */
    public Map<String,Object> getAlertInfoById(@Param("workId") String workId);

    /**
     * 根据作业id修改该作业被催促过的信息
     * @param workId
     * @return
     */
    public void updateAlertInfoById(@Param("workId") String workId);

    /**
     * 根据状态查询作业  0未开始 1进行中2已结束
     * @param status
     * @return
     */
    public List<Map<String,Object>> getWorkByStatus(@Param("status") String status);

    /**
     * 批量将作业状态由未开始变为进行中 /批量将作业状态由进行中变为已结束
     * @param status
     * @return
     */
    public void updateWorkStatusBatch(@Param("workIds") String workIds,@Param("status") String status);


//===========================================小程序端=============【begin】===============================================================


    /**
     * 学生在小程序端查询属于自己的作业列表/作业详情
     * @param studentId
     * @param workId
     * @return
     */
    public List<WorkDto> getWorkListByStudentId(@Param("studentId") String studentId, @Param("workId") String workId, @Param("reached") Integer reached);


    /**
     * 某个作业已完成的人数
     * @param workId
     * @return
     */
    public int getCompletedByWorkId(@Param("workId") String workId);


//===========================================小程序端=============【end】===============================================================





//===========================================PC端作业模块=============【begin】===============================================================


    /**
     * 首页作业列表
     * @param params
     * @return
     */
    public List<HlifeWorkStudent> getIndexWorksByTeacherIdForPc(Map params);

    /**
     * 作业下拉选择列表
     * @param params
     * @return
     */
    public List<Map<String,Object>> getWorksByTeacherIdForPc(Map params);

    /**
     * 最近作业列表
     * @param params
     * @return
     */
    //public List<Map<String,Object>> getWorkListByTeacherIdForPc(Map params);
    public List<ExcelDto1> getWorkListByTeacherIdForPc(Map params);

    /**
     * 作业详情及统计
     * @param workId
     * @return
     */
    public Map<String,Object> getWorkDetailForPc(@Param("workId") Long workId);


    /**
     * 个人作业记录【时长模式】
     * @param studentId
     * @return
     */
    public Map<String,Object> getStudentPersonalInfoDetailForPc1(@Param("studentId") String studentId,@Param("orgId") String orgId);

    public Map<String,Object> getStudentPersonalInfoDetailForPcPercent(@Param("studentId") String studentId,@Param("orgId") String orgId,@Param("modelType") String modelType);


    public Map<String,Object> getTeacherWorkForPcPercent(@Param("teacherId") String teacherId,@Param("orgId") String orgId,@Param("classId") String classId);

    //2、本年级平均成绩结构对比
    public Map<String,Object> getPcIndex2(@Param("gradeName") String gradeName,@Param("gradeName1") String gradeName1,@Param("orgId") String orgId,@Param("time") String time);
    public Map<String,Object> getPcIndex22(@Param("gradeName") String gradeName,@Param("gradeName1") String gradeName1,@Param("orgId") String orgId,@Param("time") String time);

    //3、我的作业布置统计
    public Map<String,Object> getPcIndex3(@Param("teacherId") String teacherId,@Param("orgId") String orgId,@Param("classId") Integer classId,@Param("time") String time);

    //4、学生作业提交率
    public Map<String,Object> getPcIndex4(@Param("teacherId") String teacherId,@Param("orgId") String orgId,@Param("classId") Integer classId,@Param("time") String time);

    List<WorkDateDto> getDayWorkListByTeacherId(Map<String, Object> params);


//===========================================PC端作业模块=============【end】===============================================================

}